fixed some unfinished code