first working version
added character location mechanism