added terrain views and factorised some functions