added functions for memory usage and getch