Removed unnecessary marking code and cleaned up allocation