references added, buggy