Finished most functionality