Adding required functionality. Code actually runs now.