corrected errors in functions - needs debuging on package install