implemented created functions but needs debug