finding solutions through logic