merged with updated decorator and works with minimal bugs