changes made in class
chaging monitor exit to inside monitor enter
working, TODO: add numSolutios to main