wrote code from pseudocode