changes performed as mihai suggested