made code cross platform