version 2 cleaned up