fixed syntax errors in function
added solutions