Edited code to suppress warnings