Fleshed out more. Bug fixes