Reviewed code forked by longility 6/9/13

After review I made changes based on critique.