some code for sylvia's thesis