Added code from Eclipse project