added new code (BUGGED)