Tidied up model and began work on user library functionality