Update

Bug fixes and create functions.