record functions complete

needs debug