added constant pool and fixed some bugs