Changed code so it supports odjects.