added flash function, completed if bank