understand the in class lectures fully but cant transfer that to rails