finished parsing and got rid of bugs in fuctions