Completed recording code, partial completion of #10