some crazy assembler code and other stuff