modified it little bit