Version 1.0 - ready for submit

Working version of functions with comments