updating new interface
adding time and optimized code