combines the function to one and all the input methods call the same function. need to rewrite it to make it more robust
adds viewports, need to add it functionally.