fixed expansion logic >_<