fixed bug, changed flow of program