input func is plugged in main.cpp