Updated README and moved some code around