implemented rails, almost completed