updated version 1 with more features