working version with some console method