Finished modifying vanilla code