Edited code for standard deviation function