Implemented rather buggy and messy dependency system