added asserts; small fixes
added assembly function; started generator.cpp