Initial implementation. Need to add support of directions