solving issues pointed out by type conversion warnings [WIP]
- all tests passed on this commit