Added main methods, renamed shadowed variables