added level end detection and graphic updates