functional submission, various fixes
various fixes, completely functional