more functions, fix elsif