last commit fixed various bugs, fully functional