corrected implementations of functions in scripts; correctly logged results to console