updated code a bit
added new version 2