created method that creates methods dynamically