More cleanup and added summaries to most functions

Signed-off-by: BunnyRabbit2 <iamlewisstorey@yahoo.com>