corrected classes & added main
works at 18k lines per min