added version 2 & cleaned up version 1