wrote test and fixed bug in solver