Re-arranged and tried to simplify code chunks in proposal