functionality nearly done