Got rid of nasty hacks

Also, should now work with class files of arbitrary length