Resolves issue 10
Resolves issue 6
Minor changes to issue 6