Cleaned code
Fixed n to k substition and figure placement